<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>订单支付</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    
   
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <style type="text/css">    
        input::-webkit-input-placeholder{
            color:#cccccc;
        }
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none !important;    
            margin: 0;
        }
    </style>
    <script type="text/javascript">
	//调用微信JS api 支付
	function jsApiCall()
	{
		WeixinJSBridge.invoke(
			'getBrandWCPayRequest',
			{$params},
			function(res){
				WeixinJSBridge.log(res.err_msg);
         if(res.err_msg == "get_brand_wcpay_request:ok" ) {
            //$.toast("支付成功，报名已正式生效");
            form1.submit();
         }else{
            $.toast("支付失败");
         } 
			}
		);
	}

	function callpay()
	{
		if (typeof WeixinJSBridge == "undefined"){
		    if( document.addEventListener ){
		        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		    }else if (document.attachEvent){
		        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
		        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		    }
		}else{
		    jsApiCall();
		}
	}
	</script>
	<script type="text/javascript">
	//获取共享地址
	function editAddress()
	{
		WeixinJSBridge.invoke(
			'editAddress',
			<?php echo $editAddress; ?>,
			function(res){
				var value1 = res.proviceFirstStageName;
				var value2 = res.addressCitySecondStageName;
				var value3 = res.addressCountiesThirdStageName;
				var value4 = res.addressDetailInfo;
				var tel = res.telNumber;
				
				alert(value1 + value2 + value3 + value4 + ":" + tel);
			}
		);
	}
	
	window.onload = function(){
		
		if (typeof WeixinJSBridge == "undefined"){
		    if( document.addEventListener ){
		        document.addEventListener('WeixinJSBridgeReady', editAddress, false);
		    }else if (document.attachEvent){
		        document.attachEvent('WeixinJSBridgeReady', editAddress); 
		        document.attachEvent('onWeixinJSBridgeReady', editAddress);
		    }
		}else{
			editAddress();
		}
		
	};
	
	</script>
</head>


<body>
  <div class="page page-current" id='router'>
    <div class="card" style="margin:0;box-shadow:none;">
    
        <div class="card-content">
          
          <div class="list-block media-list">
            <ul>
              <li style="padding-top: .75rem;padding-left: 1rem;" class="item-content">
                <div class="item-media">
                  <img src="__HOME_IMG__/default/ticket.png">
                </div>
                <div class="item-inner">
                  <div class="item-title-row">
                    <div class="item-title"><font size="4em">课程【{$info.title}】预订</font></div>
                  </div>
                  <div class="item-subtitle"><font color="gray" size="1.5em">{$info.address}</font></div>
                </div>
              </li>
            </ul>
          </div>
        </div>
        
    </div>       
      <form action="{:U('fpay')}" method="post" name="form1" id="form1">
        <input type="hidden" name="inviteid" value="{$info.id}">
        <input type="hidden" name="mobile" value="{$order.mobile}">
        <input type="hidden" name="id" value="{$order.id}">
      <div class="card" style="margin:0.5rem 0 0 0;box-shadow:none;">
        <div class="list-block">
            <ul>
              <!-- Text inputs -->
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-email"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">姓&#12288;名 </div>
                    <div class="item-input">
                      {$order.name}
                    </div>
                  </div>
                </div>
              </li>
              
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-email"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">手机号 </div>
                    <div class="item-input">
                      {$order.mobile}
                    </div>
                  </div>
                </div>
              </li>
              
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-gender"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">参与场次 </div>
                    <div class="item-input">
                      {$order.jointime|date='Y-m-d H:i',###}
                    </div>
                  </div>
                </div>
              </li>
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-gender"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">预订人数</div>
                    <div class="item-input">
                      {$order.joinnum}
                    </div>
                  </div>
                </div>
              </li>
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-gender"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">购买清单</div>
                    <div class="item-input">
                      <volist name="order.price_split" id="vo">
                        {$vo.name}:{$vo.price}元*{$vo.num}<br>
                      </volist>
                    </div>
                  </div>
                </div>
              </li>
              <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-gender"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">订单金额</div>
                    <div class="item-input">
                      <font color="#9ACD32"><b><span style="color:#f00;font-size:50px">{$order.realprice}元</span></b></font>
                    </div>
                  </div>
                </div>
              </li>
              
              
             
              <li style="height:1.5rem">
              	
                </li>
            </ul>
          </div>

          <div class="content-block">
            <div class="row">
              <div class="col-100"><a href="#" onclick="javascript:callpay();" class="button button-big button-fill button-success" style="background-color: #c4863d;">立即支付</a></div>
            </div>
          </div>
          <div class="content-block">
            &nbsp;&nbsp;
          </div>
      </div>
        </form>
</div>
</body>

</html>
